/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author flore_tchouanguem
 */
@Entity
@Table(name = "StoreDocument")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "StoreDocument.findAll", query = "SELECT s FROM StoreDocument s"),
    @NamedQuery(name = "StoreDocument.findByIdStoreDocument", query = "SELECT s FROM StoreDocument s WHERE s.idStoreDocument = :idStoreDocument"),
    @NamedQuery(name = "StoreDocument.findByNomStoreDocument", query = "SELECT s FROM StoreDocument s WHERE s.nomStoreDocument = :nomStoreDocument"),
    @NamedQuery(name = "StoreDocument.findByTypeDocument", query = "SELECT s FROM StoreDocument s WHERE s.typeDocument = :typeDocument"),
    @NamedQuery(name = "StoreDocument.findByDateDerniereModification", query = "SELECT s FROM StoreDocument s WHERE s.dateDerniereModification = :dateDerniereModification")})
public class StoreDocument implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idStoreDocument")
    private Integer idStoreDocument;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 256)
    @Column(name = "nomStoreDocument")
    private String nomStoreDocument;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 30)
    @Column(name = "typeDocument")
    private String typeDocument;
    @Basic(optional = false)
    @NotNull
    @Column(name = "date_derniere_modification")
    @Temporal(TemporalType.DATE)
    private Date dateDerniereModification;
    @Basic(optional = false)
    @NotNull
    @Lob
    @Column(name = "contenuDocument")
    private byte[] contenuDocument;

    public StoreDocument() {
    }

    public StoreDocument(Integer idStoreDocument) {
        this.idStoreDocument = idStoreDocument;
    }

    public StoreDocument(Integer idStoreDocument, String nomStoreDocument, String typeDocument, Date dateDerniereModification, byte[] contenuDocument) {
        this.idStoreDocument = idStoreDocument;
        this.nomStoreDocument = nomStoreDocument;
        this.typeDocument = typeDocument;
        this.dateDerniereModification = dateDerniereModification;
        this.contenuDocument = contenuDocument;
    }

    public Integer getIdStoreDocument() {
        return idStoreDocument;
    }

    public void setIdStoreDocument(Integer idStoreDocument) {
        this.idStoreDocument = idStoreDocument;
    }

    public String getNomStoreDocument() {
        return nomStoreDocument;
    }

    public void setNomStoreDocument(String nomStoreDocument) {
        this.nomStoreDocument = nomStoreDocument;
    }

    public String getTypeDocument() {
        return typeDocument;
    }

    public void setTypeDocument(String typeDocument) {
        this.typeDocument = typeDocument;
    }

    public Date getDateDerniereModification() {
        return dateDerniereModification;
    }

    public void setDateDerniereModification(Date dateDerniereModification) {
        this.dateDerniereModification = dateDerniereModification;
    }

    public byte[] getContenuDocument() {
        return contenuDocument;
    }

    public void setContenuDocument(byte[] contenuDocument) {
        this.contenuDocument = contenuDocument;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idStoreDocument != null ? idStoreDocument.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof StoreDocument)) {
            return false;
        }
        StoreDocument other = (StoreDocument) object;
        if ((this.idStoreDocument == null && other.idStoreDocument != null) || (this.idStoreDocument != null && !this.idStoreDocument.equals(other.idStoreDocument))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.entities.StoreDocument[ idStoreDocument=" + idStoreDocument + " ]";
    }
    
}
